package org.qqcui.designpattern.patterns.adapter.clazz;

/**
 * 将220V交流电转换为5V直流电的适配器类
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2022/4/28 16:45
 **/
public class VoltageAdapter extends Voltage220V implements IVoltage5V {
    @Override
    public int output5v() {
        // 获得交流电的电压
        int src = output220v();
        // 通过硬件降压为5V直流电
        int dst = src / 44;
        System.out.println("降压为：" + dst +"V直流电");
        return dst;
    }
}
